const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    transpileDependencies: [true],
    devServer: {
        hot: true
    },
    configureWebpack: {
        name: '测试',
        resolve: {
            alias: {
                '@': resolve('src')
            }
        }
    },
    chainWebpack: config => {
        config.module.rule('worker')
            .test(/\.worker\.js$/)
            .use('worker-loader')
            .loader('worker-loader')
            .options({ inline: 'fallback' })
    }
}
